<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDistributionUpgradeOptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distribution_upgrade_options', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('from_rule_id')      ->default(0)->comment('起始规则id');
            $table->bigInteger('to_rule_id')        ->default(0)->comment('到达规则id');
            $table->integer('son_user_limit')       ->default(0)->comment('累计发展下级分销商');
            $table->integer('son_user_require')     ->default(0)->comment('0或，1与');
            $table->decimal('distribution_money_limit')->default(0)->comment('累计分销订单金额达');
            $table->integer('distribution_money_require')->default(0)->comment('0或，1与');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distribution_upgrade_options');
    }
}
